home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <ctype.h>
- main()
- {
- int ch, count,
- mark = 0xdb; /* to mark characters */
-
- /* Go over entire ASCII table and display the
- * alphabetic ones.
- */
-
- printf(
- "Letters are marked with a %c\n", mark);
-
- printf(" ");
- for(count = 0, ch = 0; ch <= 0x07f; ch++)
- {
- printf("%#02x", ch);
- if(ch < 0xf)
- printf(" ");
-
-
- /* Print character- if printable */
- if(isprint(ch))
- {
- printf(" %c", ch);
-
- }
- else
- {
- printf(" ");
- }
-
- /* Perform a test and put a mark if test succeeds */
-
- if(isalpha(ch) != 0)
- {
- printf("%c ", mark);
- }
- else
- {
- printf(" ", ch);
- }
- count++;
- if(count == 8)
- {
- printf(" \n");
- count = 0;
- }
- }
- }
-